package Persistence;

import java.util.ArrayList;
import java.util.List;

import android.content.ContentValues;
import android.util.Log;
import Domain.IDomainObject;
import Domain.NoteCard;

/**
 * Repository class for the Note Cards table.
 * */
public class NoteCardRepository implements IRepository{
	
	private final DatabaseHelper _DBManager;
	
	/**
	 * Default constructor. Sets the database manager instance. 
	 * @param	dbManager	The database manager to use
	 * */
	public NoteCardRepository(DatabaseHelper dbManager){
		_DBManager = dbManager;
	}
	
	/**
	 * Adds a row to the Note Cards table.
	 * @param	noteCard	The note card instance to add
	 * */
	@Override
	public NoteCard addRow(IDomainObject noteCardToAdd){
		NoteCard noteCard = (NoteCard)noteCardToAdd;
		ContentValues values = new ContentValues();
		/*values.put(_DBManager.NOTECARDS_ROW_DECKID, noteCard.DeckID);
		values.put(_DBManager.NOTECARDS_ROW_FRONT, noteCard.Front);
		values.put(_DBManager.NOTECARDS_ROW_BACK, noteCard.Back);*/
		
		try
		{
			//noteCard.ID = (int)_DBManager.db.insert(_DBManager.NOTECARDS_TABLE, null, values);
		}
		catch(Exception e)
		{
			Log.e("DB ERROR", e.toString());
			e.printStackTrace();
		}
		
		return noteCard;
	}

	@Override
	public void deleteRow(IDomainObject domainObject) {
		// TODO Auto-generated method stub
		
	}

	public ArrayList<IDomainObject> getAllRows() {
		// TODO Auto-generated method stub
		return null;
	}
	
	@Override
	public NoteCard getRow(int rowID) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void updateRow(IDomainObject domainObject) {
		// TODO Auto-generated method stub
	}
	
}
